package com.relax.no_xml.demo;

import com.relax.no_xml.bean.ImportColor;
import com.relax.no_xml.bean.Person;
import com.relax.no_xml.config.PqsConfig;
import com.relax.no_xml.ignoreDependenceInterface.A;
import com.relax.no_xml.ignoreDependenceInterface.impl.CImpl;
import com.relax.no_xml.service.HelloService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.util.SocketUtils;

public class SpringDemo {
	public static void main(String[] args) {
		final ApplicationContext application = new AnnotationConfigApplicationContext(PqsConfig.class);
		System.out.println("======================");
		final Person person = application.getBean(Person.class);
		System.out.println(person);
		HelloService bean = application.getBean(HelloService.class);
		bean.hello();


		System.out.println("======================");

		CImpl c = application.getBean(CImpl.class);
		c.helloC();


//		System.out.println("===========helloService.hello()方法===========");
//		final HelloService helloService = (HelloService) application.getBean("helloServiceImpl");
//		helloService.hello();
//
//		//
//
//		final A a = application.getBean(A.class);
//		System.out.println(a);

		//测试import
		ImportColor importColor = application.getBean(ImportColor.class);
		System.out.println("importColor======>"+importColor);


	}
}
